import os
import sys

domain_map = [
                 'government',
                 'slate',
                 'telephone',
                 'travel',
                 'facetoface',
                 'letters',
                 'nineeleven',
                 'oup',
                 'verbatim',
                 'fiction'
]


py_file = "./OnlineIR_test.py"
dir_path = os.path.abspath(py_file).strip(py_file)
for batchsize in [32, 64]:
    for FS in [20, 40, 60, 80, 100]:
        for domain_id in range(1, 11):
            with open(py_file) as fr:
                with open(f"./OnlineIR_{domain_map[domain_id-1]}_FS{FS}_BS{batchsize}.py", 'w') as fw:
                    codes = fr.read()
                    codes = codes.replace("domain_id = 2", f"domain_id = {domain_id}")
                    codes = codes.replace("max_data_size=20)", f"max_data_size=20)")
                    codes = codes.replace("batch_size=64)", f"batch_size={batchsize})")
                    fw.write(codes)